/*
	this class is used to keep track of max/related object data
*/

#ifndef _B2_USER_DATA
#define _B2_USER_DATA

#include "b2d_common.h"

#include "Box2D.h"

enum { // anonymous enum!
	/* bodies */
	e_b2BodyType, // base class
	/* shapes */
	e_b2ShapeType, // base class
	e_b2CircleShapeType,
	e_b2PolygonShapeType,
	/* joints */
	e_b2JointType, // base class
	e_b2DistanceJointType,
	e_b2GearJointType,
	e_b2MouseJointType,
	e_b2PrismaticJointType,
	e_b2PulleyJointType,
	e_b2RevoluteJointType
}; 

class b2UserData {

	public:
		b2UserData(const char* my_name, int my_objecttype, void* my_object, bool draw_me = true);
		
		/* what is this user data representing? */
		int		b2ObjectType; // e_bodyType, e_shapeType, e_jointType (used to cast the pointer below)
		void*	b2Object;  // a pointer to the object in the b2world (possibly an array of objects in the case of polys)

		/* the user data */
		const char*					name;		// the name of this object
		bool						draw;		// should this object be drawn?
		long						age;		// the age of the object
		
		/* the max/msp user data */
		long ac;
		t_atom av[1024]; // allocate 1024


		b2PolygonShape*		polys[1024];
		int					nPolys;



};

#endif